This nonprovisional application claims priority under 35 U.S.C xc2xa7119(a) on Patent Application No. 2001-373729 filed in JAPAN on Dec. 7, 2001, which is herein incorporated by reference
1. Field of the Invention
The present invention relates to a distance measuring apparatus, and particularly to a distance measuring apparatus of, for example, a camera, using passive AF sensors.
2. Description of the Related Art
A distance measuring apparatus of a camera using an AF sensor in a passive method captures images of a distance measurement object by, for example, a pair of left and right line sensors, and obtains left and right sensor images (AF data). In the AF data obtained from the pair of left and right sensors, a pair of window ranges for obtaining a pair of AF data for use in a correlation value calculation are determined, and the pair of AF data for use in the correlation value calculation are sequentially obtained by shifting the pair of window ranges in the opposite directions in a pair of predetermined sensor areas (employed sensors). Otherwise, a pair of AF data for use in a correlation value calculation are sequentially obtained with one window range fixed, and another window range shifted. A distance from the distance measurement object is calculated according to an amount of shift of the window range when the highest correlation is obtained by obtaining the correlation of the obtained pair of AF data (i.e., when the left and right images in the pair of employed sensors match each other).
However, when the contrast in the left and right sensor images is low, the appropriate correlation cannot be acquired, thereby possibly making an erroneous measurement.
For avoiding the erroneous measurement, in the conventional method (1) shown in FIG. 90, the contrast in the AF data in the employed sensors is detected (step S1500) and the presence/absence of contrast is determined (step S1502) prior to a correlation value calculation. The correlation value calculation is performed (step S1504) only when it is determined that there is the contrast. If it is determined that there is no contrast, no measurement can be made (step S1506).
In the conventional method (2) shown in FIG. 91, a correlation value calculation is first performed (step S1510). Then, the contrast of the AF data in a pair of window ranges when the highest correlation is obtained is detected (step S1512), and it is determined whether or not there is sufficient contrast (step S1514). Only when it is determined that sufficient contrast is detected, control is passed to the process of calculating the distance to a subject, etc. If it is determined that no sufficient contrast is detected, then no measurement can be made (step S1516) (Japanese Patent Application Publication No. 12-131016).
However, in the conventional method (1), the appropriate contrast can be detected only outside the pair of window ranges where the highest correlation is obtained, that is, there can be low contrast of the AF data in the window range, thereby possibly making an erroneous measurement.
Moreover, in the conventional method (2), the contrast of the AF data is determined in the window range where the highest correlation is obtained after a correlation value calculation is performed. Therefore, if no measurement can be made when contrast is checked, unnecessary correlation value calculation can be performed (it takes a long time for performing a correlation value calculation).
The present invention has been achieved to solve the above-mentioned problems with the conventional technology, and aims at providing a distance measuring apparatus capable of minimizing unnecessary correlation value calculations at a low contrast level, and successfully avoiding an erroneous measurement.
In order to attain the above-described object, the present invention is directed to a distance measuring apparatus, comprising: an AF data generating device which forms images of light from a distance measurement object on a pair of line sensors comprising a plurality of light-receiving elements and generates a pair of AF data for correlation value calculation according to signals obtained from the plurality of light-receiving elements; a first AF data obtaining device which obtains a pair of AF data from a pair of employed sensor ranges for use in distance measurement in the pair of line sensors; a second AF data obtaining device which determines a pair of window ranges for obtaining the pair of AF data for use in the correlation value calculation in the pair of employed sensor ranges, and sequentially obtains the pair of AF data for use in the correlation value calculation while shifting the pair of window ranges to obtain a highest correlation in the pair of employed sensors; a first contrast determining device which determines whether or not the pair of AF data obtained by the first AF data obtaining device have a first predetermined necessary contrast for a distance measurement; a correlation value calculating device which calculates correlation between the pair of AF data obtained by the second AF data obtaining device only when the first contrast determining device determines that there is the first predetermined necessary contrast; a second contrast determining device which determines whether or not the AF data in the pair of window ranges when a highest correlation is obtained in the correlation obtained by the correlation value calculating device have a second predetermined necessary contrast for the distance measurement; and a distance measurement object distance calculating device which calculates a distance from the distance measurement object according to a shift amount of the pair of window ranges when the highest correlation is obtained only when the second contrast determining device determines that there is the second predetermined necessary contrast.
According to the present invention, the second contrast determining device determines whether or not there is the predetermined necessary contrast in the AF data in the pair of window ranges in a distance measurement where the highest correlation is obtained. Only when it is determined that there is the contrast, the distance from the distance measurement object is calculated according to the shift amount of the window ranges where the highest correlation is obtained, thereby avoiding a possible erroneous measurement which can be made by low contrast of AF data in the window range.
In order to attain the above-described object, the present invention is also directed to a distance measuring apparatus, comprising: an AF data generating device which forms images of light from a distance measurement object on a pair of line sensors comprising a plurality of light-receiving elements and generates a pair of AF data for correlation value calculation according to signals obtained from the plurality of light-receiving elements; an AF data obtaining device which determines a pair of window ranges for obtaining the pair of AF data for use in the correlation value calculation in a pair of employed sensor ranges for use in distance measurement in the pair of line sensors, and sequentially obtains a pair of AF data for use in the correlation value calculation while shifting the pair of window ranges to obtain a highest correlation in the pair of employed sensors; a contrast determining device which determines for each of shift amounts of the pair of window ranges whether or not the pair of AF data obtained by the AF data obtaining device has predetermined necessary contrast for a distance measurement; a correlation value calculating device which calculates correlation between the pair of AF data obtained by the AF data obtaining device only when the contrast determining device determines that there is the predetermined necessary contrast in at least one of the shift amounts of the pair of window ranges; and a distance measurement object distance calculating device which calculates a distance from the distance measurement object according to the shift amount of the pair of window ranges when the highest correlation is obtained in the correlation obtained by the correlation value calculating device.
According to the present invention, it is determined whether or not AF data in a pair of window ranges indicates predetermined contrast required in a distance measurement for each shift amount in a window range, and a correlation value calculation is performed on a shift amount where it is determined that contrast is detected or on all shift amounts only when there is contrast detected in at least one of shift amounts in the window ranges. Therefore, in any shift amount, an unnecessary correlation value calculation using AF data indicating no contrast can be omitted. Moreover, if a correlation value calculation is performed on all shift amounts when there is contrast detected in at least one of shift amounts, only when it is determined that there is contrast in a window range of the shift amount where the highest correlation is obtained by the correlation value calculation, the distance from the distance measurement object is calculated on the shift amount, thereby avoiding an erroneous measurement possibly made when AF data in the window range indicates low contrast.
In order to attain the above-described object, the present invention is also directed to a distance measuring apparatus, comprising: an AF data generating device which forms images of light from a distance measurement object on a pair of line sensors comprising a plurality of light-receiving elements and generates a pair of AF data for correlation value calculation according to signals obtained from the plurality of light-receiving elements; a first AF data obtaining device which obtains a pair of AF data from a pair of employed sensor ranges for use in distance measurement in the pair of line sensors; a second AF data obtaining device which determines a pair of window ranges for obtaining the pair of AF data for use in the correlation value calculation in the pair of employed sensor ranges, and sequentially obtains the pair of AF data for use in the correlation value calculation while shifting the pair of window ranges to obtain a highest correlation in the pair of employed sensors; a first contrast determining device which determines whether or not the pair of AF data obtained by the first AF data obtaining device have a first predetermined necessary contrast for a distance measurement; a second contrast determining device which determines for each of shift amounts of the pair of window ranges whether or not the pair of AF data obtained by the second AF data obtaining device have a second predetermined necessary contrast for the distance measurement only when the first contrast determining device determines that there is the first predetermined necessary contrast; a correlation value calculating device which calculates correlation between the pair of AF data obtained by the second AF data obtaining device only when the second contrast determining device determines that there is the second predetermined necessary contrast in at least one of the shift amounts of the pair of window ranges; and a distance measurement object distance calculating device which calculates a distance from the distance measurement object according to the shift amount of the pair of window ranges when the highest correlation is obtained in the correlation obtained by the correlation value calculating device.
According to the present invention, in any shift amount, an unnecessary correlation value calculation using AF data indicating no contrast can be omitted. Moreover, an erroneous measurement possibly made when AF data in the window range indicates low contrast can be avoided. Furthermore, when there is no predetermined contrast required by AF data in the employed sensor range in the distance measurement, the subsequent unnecessary determination of contrast can be omitted.
Preferably, the pair of employed sensors are sensors for the entire measurement area of the pair of line sensors. Alternatively, the entire measurement area of each of the pair of line sensors is divided into a plurality of subareas, and the pair of employed sensors are sensors for the subareas. In the latter case, even if a measurement cannot be made in an employed sensor, it is probably made in another employed sensor.
Preferably, the first contrast determining device comprises: a contrast detecting device which obtains a difference between a largest value and a smallest value of the AF data obtained by the first AF data obtaining device; and a determining device which determines presence/absence of the contrast depending on whether or not the difference obtained by the contrast detecting device is equal to or larger than a predetermined reference value.
Preferably, the second contrast determining device comprises: a contrast detecting device which obtains a difference between a largest value and a smallest value of the AF data obtained by the second AF data obtaining device; and a determining device which determines presence/absence of the contrast depending on whether or not the difference obtained by the contrast detecting device is equal to or larger than a predetermined reference value.
Preferably, the contrast determining device comprises: a contrast detecting device which obtains a difference between a largest value and a smallest value of the AF data obtained by the AF data obtaining device; and a determining device which determines presence/absence of the contrast depending on whether or not the difference obtained by the contrast detecting device is equal to or larger than a predetermined reference value.